﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    xmlns:regions="clr-namespace:Microsoft.Practices.Composite.Presentation.Regions;assembly=Microsoft.Practices.Composite.Presentation"
    xmlns:controls="clr-namespace:Soat.HappyNet.Silverlight.Library.Controls;assembly=Soat.HappyNet.Silverlight.Library" 
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:layout="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="ColorBrush.xaml"/>
        <ResourceDictionary Source="ButtonStyles.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    
    <Style x:Key="DefaultShellStyle" TargetType="ContentControl">
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControl">
                    <Grid x:Name="LayoutRoot">
                    	<Grid.Background>
                    		<LinearGradientBrush EndPoint="0.5,2.635" StartPoint="0.5,-1.635">
                    			<GradientStop Color="#FFD7DBC0"/>
                    			<GradientStop Color="#FFFDFCE8" Offset="1"/>
                    		</LinearGradientBrush>
                    	</Grid.Background>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition />
                        </Grid.RowDefinitions>

                        <!--Header-->
                        <Grid x:Name="Header"
                              Grid.Row="0">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition />
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            
                            <Grid Grid.Row="1">
                                <Rectangle Fill="{StaticResource HeaderBackgroundBrush}"/>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    
                                    <StackPanel Grid.Column="0"
                                                HorizontalAlignment="Left" 
                                                Orientation="Horizontal" 
                                                VerticalAlignment="Center">
                                        <!--Logo-->
                                        <ContentControl x:Name="Logo" Style="{StaticResource LogoStyle}" VerticalAlignment="Center" Margin="0,-5,0,-15"/>
                                        <!--Title-->
                                        <TextBlock x:Name="Title" 
										        Style="{StaticResource ApplicationTitleText}"
										        Text="{Binding Path=Strings.APP_ApplicationName, Source={StaticResource LocalizedStrings}}"/>
                                    </StackPanel>
                                    
                                    <!-- Notification region -->
                                    <Grid Grid.Column="1">
                                        <ContentControl regions:RegionManager.RegionName="NotificationsRegion"
                                                        HorizontalContentAlignment="Stretch"
                                                        VerticalContentAlignment="Stretch"/>
                                    </Grid>

                                    <!--Login State-->
                                    <Grid Margin="5,0,5,5"
                                          Grid.Column="2">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        
                                        <ContentControl x:Name="LanguageSwitchRegion" 
                                                      Grid.Row="0"
                                                      regions:RegionManager.RegionName="LanguageSwitchRegion" 
                                                      HorizontalAlignment="Right"
                                                        Margin="0,0,10,0"/>
                                        
                                        <ContentControl x:Name="LoginStateRegion" 
                                                      Grid.Row="1"
                                                      Margin="0,5,0,5"
                                                      regions:RegionManager.RegionName="LoginStateRegion" 
                                                      HorizontalAlignment="Right" 
                                                      VerticalAlignment="Top"/>
                                    </Grid>
                                </Grid>
                            </Grid>

                            <Rectangle Fill="{StaticResource TitleHeaderBrush}"
                                       Height="3"
                                       VerticalAlignment="Top">
                                <Rectangle.Effect>
                                    <DropShadowEffect Direction="270" 
                                                      ShadowDepth="2" 
                                                      Opacity="0.6"
                                                      BlurRadius="10"/>
                                </Rectangle.Effect>
                            </Rectangle>
							
                            <Grid Grid.Row="2" 
                            	VerticalAlignment="Bottom"
                            	HorizontalAlignment ="Right" RenderTransformOrigin="0.5,0.5" Margin="0,-20,0,0">
                            	<Border Margin="0,19,0,0" CornerRadius="0,0,0,20">
                            		<Border.Effect>
                            			<DropShadowEffect ShadowDepth="3" BlurRadius="8" Direction="270"/>
                            		</Border.Effect>
                            		<Border.Background>
                            			<SolidColorBrush Color="{StaticResource BottomHeaderBackgroundColor}"/>
                            		</Border.Background>
                            	</Border>
                            	<ContentControl x:Name="MenuRegion"
                            		            regions:RegionManager.RegionName="MenuRegion" 
                                                HorizontalAlignment="Right" 
                                                VerticalAlignment="Center" 
                                                Margin="18,0,0,0" />
                            </Grid>
                        </Grid>
                        <Grid Grid.Row="1">
                            <!--Center Content-->
                            <ContentPresenter Content="{TemplateBinding Content}"
                                              HorizontalAlignment="Stretch"
                                              VerticalAlignment="Stretch"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--DefaultPage Style-->
    <Style x:Key="DefaultPageStyle" TargetType="controls:WindowContentControl">
    	<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    	<Setter Property="VerticalContentAlignment" Value="Stretch"/>
    	<Setter Property="Background" Value="White"/>
        <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" />
    	<Setter Property="BorderBrush" Value="{StaticResource DefaultBorderBrush}"/>
        <Setter Property="Margin" Value="8" />
    	<Setter Property="Template">
    		<Setter.Value>
    			<ControlTemplate TargetType="controls:WindowContentControl">
    				<Grid x:Name="Root" d:DesignWidth="232" d:DesignHeight="111.667" >
    					<Grid x:Name="ContentRoot" RenderTransformOrigin="0.5,0.5">
    							<Border Margin="5,5,1,1" 
    							BorderThickness="1,1,1,1" Background="{TemplateBinding Background}">
    							    <Border.Effect>
    								    <DropShadowEffect ShadowDepth="0" BlurRadius="15" Opacity="0.75"/>
    							    </Border.Effect>
    						</Border>
							<Grid>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="Auto" />
									<ColumnDefinition/>
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="10"/>
									<RowDefinition/>
								</Grid.RowDefinitions>
                                <Grid x:Name="Header"
                                      VerticalAlignment="Top" Margin="0,-12,0,0">
                                	<Grid.Effect>
                                		<DropShadowEffect ShadowDepth="0" BlurRadius="12"/>
                                	</Grid.Effect>
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="Auto"/>
										<ColumnDefinition Width="Auto"/>
									</Grid.ColumnDefinitions>
									<Border x:Name="HeaderTitle" Padding="6,5" 
										    Background="{StaticResource PageHeaderBackgroundBrush}" 
                                            BorderThickness="0">
										<Grid Background="Transparent">
											<Grid HorizontalAlignment="Stretch">
												<Grid.ColumnDefinitions>
													<ColumnDefinition Width="15"/>
													<ColumnDefinition Width="*"/>
												</Grid.ColumnDefinitions>
												<Path x:Name="HorizontalArrow" Stretch="Fill" StrokeThickness="3" StrokeLineJoin="Round" Stroke="{TemplateBinding Foreground}" Data="F1 M 8.5,6.5L 13.5,11.5L 8.5,16.51" Grid.Column="0" Margin="5,0,0,0" Visibility="Collapsed"/>
												<TextBlock x:Name="header_Copy" Style="{StaticResource FrameHeaderText}" Text="&gt;" FontWeight="Bold" FontSize="21.333" Margin="2,0,0,0" />
												<TextBlock x:Name="header" 
													Text="{TemplateBinding Title}"
													Margin="4,0,0,0"  
													Grid.Column="1" Style="{StaticResource FrameHeaderText}" />
											</Grid>
										</Grid>
									</Border>
								</Grid>
								<Grid Grid.Column="1" Grid.Row="0"
									Margin="5,8,5,0">
									<ContentControl Content="{TemplateBinding HeaderContent}"
										HorizontalContentAlignment="Stretch"
										VerticalContentAlignment="Stretch"/>
								</Grid>
								<Border Margin="11,0,6,6" Grid.Row="2" Grid.ColumnSpan="3">
                                    <ContentPresenter Content="{TemplateBinding Content}" 
								            ContentTemplate="{TemplateBinding ContentTemplate}" 
								            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
									        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                </Border>
							</Grid>
    					</Grid>
    				</Grid>
    			</ControlTemplate>
    		</Setter.Value>
    	</Setter>
    	<Setter Property="MinWidth" Value="200"/>
    	<Setter Property="MinHeight" Value="100"/>
    </Style>
    
    <Style x:Key="HeaderedContentStyle" TargetType="toolkit:HeaderedContentControl">
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="#20000000" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:HeaderedContentControl">
                    <Border BorderThickness="{TemplateBinding BorderThickness}" 
                            BorderBrush="{TemplateBinding BorderBrush}"
                            Margin="1,0,1,0">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <Grid Margin="0,0,0,2"
                              Grid.Row="0">
                                <Border CornerRadius="1,1,1,1"
                                    Background="{StaticResource HeaderBackgroundBrush}">
                                    <Border.Effect>
                                        <DropShadowEffect ShadowDepth="0" BlurRadius="8" Opacity="0.70"/>
                                    </Border.Effect>
                                </Border>
                                <TextBlock Style="{StaticResource HeaderLabelStyle}"
                                       TextAlignment="Center"
                                       HorizontalAlignment="Center"
                                       Text="{TemplateBinding Header}" 
                                       Margin="6,4,6,4"/>
                            </Grid>
                            <ContentPresenter Content="{TemplateBinding Content}" 
                                          Grid.Row="1"
                                          ContentTemplate="{TemplateBinding ContentTemplate}" 
                                          Cursor="{TemplateBinding Cursor}" 
                                          Margin="{TemplateBinding Padding}" 
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="BorderedContentControlStyle" TargetType="ContentControl">
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="#20000000" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControl">
                    <Border BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}">
                        <ContentPresenter Content="{TemplateBinding Content}" 
                                          Grid.Row="1"
                                          ContentTemplate="{TemplateBinding ContentTemplate}" 
                                          Cursor="{TemplateBinding Cursor}" 
                                          Margin="{TemplateBinding Padding}" 
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="controls:AnimatedExpander" x:Key="AnimatedExpanderStyle">
        <Setter Property="HeaderStyle" Value="{StaticResource ExpanderToggleButtonStyle}" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
        <Setter Property="HeaderForeground" Value="{StaticResource ForegroundBrush}"/>
        <Setter Property="HeaderBackground" Value="{StaticResource DiscreteHeaderBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="#20000000" />
        <Setter Property="Background" Value="{StaticResource DiscreteBackgroundBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:AnimatedExpander">
                    <Border BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            Padding="{TemplateBinding Padding}"
                            x:Name="LayoutRoot">
                        <Border.Resources>
                            <Storyboard x:Key="ExpandStoryboard">
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ScrollViewer" Storyboard.TargetProperty="(FrameworkElement.Height)">
                                    <SplineDoubleKeyFrame x:Name="ExpandKeyFrame" Value="100" KeyTime="00:00:00.5"
                                                          KeySpline="0,0.5,0.5,1" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                            <Storyboard x:Key="CollapseStoryboard">
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ScrollViewer" Storyboard.TargetProperty="(FrameworkElement.Height)">
                                    <SplineDoubleKeyFrame x:Name="CollapseKeyFrame" Value="0" KeyTime="00:00:00.5"
                                                          KeySpline="0,0.5,0.5,1" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </Border.Resources>
                        <StackPanel>
                            <ToggleButton x:Name="ExpandToggleButton"
                                  		 IsChecked ="{TemplateBinding IsExpanded}"
	                                     Foreground="{TemplateBinding HeaderForeground}"
										 Background="{TemplateBinding HeaderBackground}"
	                                     Padding="{TemplateBinding Indentation}"
										 Style="{TemplateBinding HeaderStyle}"
                                  		 HorizontalContentAlignment="Stretch" 
                                          Cursor="Hand">
                                <ContentPresenter
                                            Content="{TemplateBinding Header}"
                                            ContentTemplate="{TemplateBinding HeaderTemplate}"
                                            Margin="{TemplateBinding Padding}"
                                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                                            />
                            </ToggleButton>
                            <ScrollViewer x:Name="ScrollViewer" 
                                          Style="{StaticResource ScrollViewerStyle}"
                                      Height="0"
                                      HorizontalScrollBarVisibility="Disabled"
                                      VerticalScrollBarVisibility="Hidden"
                                      BorderThickness="0"
                                      Padding="0">
                                <Border Background="{TemplateBinding Background}">
                                    <ContentPresenter
                                                x:Name="ContentContentPresenter"
                                                Content="{TemplateBinding Content}"
                                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                                Cursor="{TemplateBinding Cursor}"
                                                Margin="{TemplateBinding Padding}"
                                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                </Border>
                            </ScrollViewer>
                        </StackPanel>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:AnimatedExpander" x:Key="NiceAnimatedExpanderStyle">
        <Setter Property="HeaderStyle" Value="{StaticResource NiceExpanderToggleButtonStyle}" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="HeaderForeground" Value="{StaticResource HeaderForegroundBrush}"/>
        <Setter Property="HeaderBackground" Value="{StaticResource HeaderBackgroundBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="#20000000" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:AnimatedExpander">
                    <Border BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            Padding="{TemplateBinding Padding}"
                            x:Name="LayoutRoot">
                        <Border.Resources>
                            <Storyboard x:Key="ExpandStoryboard">
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ScrollViewer" Storyboard.TargetProperty="(FrameworkElement.Height)">
                                    <SplineDoubleKeyFrame x:Name="ExpandKeyFrame" Value="100" KeyTime="00:00:00.5"
                                                          KeySpline="0,0.5,0.5,1" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                            <Storyboard x:Key="CollapseStoryboard">
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ScrollViewer" Storyboard.TargetProperty="(FrameworkElement.Height)">
                                    <SplineDoubleKeyFrame x:Name="CollapseKeyFrame" Value="0" KeyTime="00:00:00.5"
                                                          KeySpline="0,0.5,0.5,1" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </Border.Resources>
                        <StackPanel>
                            <ToggleButton x:Name="ExpandToggleButton"
                                  		 IsChecked ="{TemplateBinding IsExpanded}"
	                                     Foreground="{TemplateBinding HeaderForeground}"
										 Background="{TemplateBinding HeaderBackground}"
	                                     Padding="{TemplateBinding Indentation}"
										 Style="{TemplateBinding HeaderStyle}"
                                  		 HorizontalContentAlignment="Center" 
                                          Cursor="Hand">
                                <ContentPresenter
                                            Content="{TemplateBinding Header}"
                                            ContentTemplate="{TemplateBinding HeaderTemplate}"
                                            Margin="{TemplateBinding Padding}"
                                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                                            />
                            </ToggleButton>
                            <ScrollViewer x:Name="ScrollViewer" 
                                          Style="{StaticResource ScrollViewerStyle}"
                                      Height="0"
                                      HorizontalScrollBarVisibility="Disabled"
                                      VerticalScrollBarVisibility="Hidden"
                                      BorderThickness="0"
                                      Padding="0">
                                <Border Background="{TemplateBinding Background}">
                                    <ContentPresenter
                                                x:Name="ContentContentPresenter"
                                                Content="{TemplateBinding Content}"
                                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                                Cursor="{TemplateBinding Cursor}"
                                                Margin="{TemplateBinding Padding}"
                                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                </Border>
                            </ScrollViewer>
                        </StackPanel>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="TransitioningContentControlStyle" TargetType="layout:TransitioningContentControl">
        <Setter Property="IsTabStop" Value="True"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Transition" Value="DefaultTransition"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="layout:TransitioningContentControl">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="PresentationStates">
                                <VisualState x:Name="DefaultTransition">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentPresentationSite" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentPresentationSite" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentPresentationSite" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="UpTransition">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentPresentationSite" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentPresentationSite" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="30"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentPresentationSite" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentPresentationSite" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="-30"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DownTransition">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentPresentationSite" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentPresentationSite" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="-40"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentPresentationSite" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentPresentationSite" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="40"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="RetractTransition">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentPresentationSite" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.GlobalOffsetZ)">
                                            <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.2000000" Value="-70">
                                                <EasingDoubleKeyFrame.EasingFunction>
                                                    <CircleEase EasingMode="EaseOut"/>
                                                </EasingDoubleKeyFrame.EasingFunction>
                                            </EasingDoubleKeyFrame>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.6000000" Value="50">
                                                <EasingDoubleKeyFrame.EasingFunction>
                                                    <QuinticEase EasingMode="EaseIn"/>
                                                </EasingDoubleKeyFrame.EasingFunction>
                                            </EasingDoubleKeyFrame>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CurrentContentPresentationSite" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0"/>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.6000000" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PreviousContentPresentationSite" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="1"/>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.6000000" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CurrentContentPresentationSite" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.0000000">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.5000000">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <ContentPresenter x:Name="PreviousContentPresentationSite" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{x:Null}" ContentTemplate="{TemplateBinding ContentTemplate}">
                                <ContentPresenter.Projection>
                                    <PlaneProjection/>
                                </ContentPresenter.Projection>
                                <ContentPresenter.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform/>
                                        <SkewTransform/>
                                        <RotateTransform/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </ContentPresenter.RenderTransform>
                            </ContentPresenter>
                            <ContentPresenter x:Name="CurrentContentPresentationSite" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{x:Null}" ContentTemplate="{TemplateBinding ContentTemplate}">
                                <ContentPresenter.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform/>
                                        <SkewTransform/>
                                        <RotateTransform/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </ContentPresenter.RenderTransform>
                            </ContentPresenter>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>